package com.qunduikj.sjb.sdk.model.enums;

/**
 * 闹钟是否开启
 *
 * @author June @http://litesuits.com
 * @date 2015-08-22
 */
public enum Isremind {
    // 利用构造函数传参
    NoOpen(1, "不开启"), IsOpenDay(2, "开启（全天）"), IsOpenTime(3, "开启（准点）");
    // 定义私有变量
    private int code;
    private String clickState;
    // 构造函数，枚举类型只能为私有


    Isremind(int code, String clickState) {
        this.code = code;
        this.clickState = clickState;
    }

    public int getCode() {
        return code;
    }

    public Isremind setCode(int code) {
        this.code = code;
        return this;
    }

    public String getClickState() {
        return clickState;
    }

    public Isremind setClickState(String clickState) {
        this.clickState = clickState;
        return this;
    }

    @Override
    public String toString() {
        return "Isremind{" +
                "code=" + code +
                ", clickState='" + clickState + '\'' +
                '}';
    }

    public static String getClickState(int cliclState) {
        Isremind isreminds[] = Isremind.values();
        for (int i = 0; i < isreminds.length; i++) {
            Isremind im = isreminds[i];
            if (im.getCode() == cliclState) {
                return im.getClickState();
            }
        }
        return "";
    }
}
